how to integrated ci api in nextjs